#ifndef __OPTION_H__
#define __OPTION_H__

// Qt Declarations
class QDomDocument;
class QDomElement;

// Qt Includes
#include <QString>
#include <QVariant>

// ******************************************************************
// COption
// ******************************************************************
class COption
{
public:
// Enums
    enum tOptionType
    {
	OPTION_TYPE_UNKNOWN,
	OPTION_TYPE_STRING,
	OPTION_TYPE_BOOL,
	OPTION_TYPE_INT,
	OPTION_TYPE_STRINGLIST
    };

// Construction & Destruction
    COption(tOptionType optionType,
	const QString &strDescription,
	const QVariant &vValue);
    COption();

// Member Accessors
    void setType(tOptionType tType) { m_tType = tType; }
    tOptionType getType() const { return m_tType; }

    void setDescription(const QString &strDescription) { m_strDescription = strDescription; }
    const QString& getDescription() const { return m_strDescription; }

    void setValue(const QVariant &vValue) { m_vValue = vValue; }
    const QVariant& getValue() const { return m_vValue; }

// Member Functions
    bool saveOption(QDomDocument &domDocument,
	QDomElement &domElement) const;
    bool loadOption(const QDomElement &domElement);

private:
// Static Member Functions
    static tOptionType getOptionType(const QString &strOptionType);
    static QVariant getOptionValue(const QString &strOptionValue,
	tOptionType tType);

// Member Variables
    tOptionType m_tType;
    QString m_strDescription;
    QVariant m_vValue;
};

#endif // #ifndef __OPTION_H__
